package org.boge.sharpdoc.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.boge.sharpdoc.bean.DocGroup;
import org.boge.sharpdoc.bean.Document;

import java.util.List;

@Mapper
public interface DocumentDao {
    public Document findById(Integer docid);

    public Integer addItem(Document document);

    public Integer findCount();

    public List<Document> findOnesUploaded(Long phone);

    public List<Document> findHottestDocs();

    public Integer updateHot(Integer docid);

    public List<Document> findByGroups(List<DocGroup> docGroups);

    public List<Document> findByKeyword(String keyword);

    public List<Document> findByGroupsAndKeyword(@Param("keyword") String keyword, @Param("docGroups") List<DocGroup> docGroups);

    public List<Document> findByStatus(String status);

    public Integer updateDownloadTimes(Integer docid);

    public Integer updateStatus(@Param("docid") Integer docid, @Param("status") String status);

    public Integer updateAuditor(@Param("docid") Integer docid, @Param("adminid") Integer adminid);
}